package com.huawang.mdesign.model.service.vo.display;

import com.huawang.business.vo.display.ShowAttribute;

import java.util.Optional;

/**
 * @author admin
 */
public class ShowAttributeAttr<T> extends ShowAttribute<T> {

    public static MeasurementAttr getObject(ShowAttribute<?> showAttribute) {
        return Optional.ofNullable(showAttribute)
                .map(ShowAttribute::getExtraAttribute)
                .filter(MeasurementAttr.class::isInstance)
                .map(MeasurementAttr.class::cast)
                .orElse(null);
    }
}
